echo off

REM CONFIGURATION

REM Directories to find C and s files to compile/assemble
set DIRS=arch . class drivers stdlib

REM Compile parameters
set CC=gcc
set CFLAGS=-fno-builtin -O0 -I include -nostdinc

REM Assemble parameters
set AS=NASM
set ASFLAGS=-f aout

REM Linker parameters
set LINKER=ld
set OBJECT_LIST_FILE=ofiles.txt
set OUTPUT_FILE=kernel.bin
set LINKER_PARAMS=-T link.txt -M


REM Perform compilation/assembly
for %%D in (%DIRS%) do call compile.bat %%D

REM Generate a list of output files (.o)
call genout.bat > ofiles.txt


echo %OUTPUT_FILE%
%LINKER% %LINKER_PARAMS% -o %OUTPUT_FILE% @%OBJECT_LIST_FILE% > ksymmap.txt

pause